﻿#region 命名空间

using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using WinnerCMS.Model;

#endregion

namespace WinnerCMS.BLL.PageFactory
{
    /// <summary>
    /// 相关内容
    /// </summary>
    [ToolboxData("<{0}:RelatedContents runat=\"server\"></{0}:RelatedContents>")]
    public class RelatedContents : DataBox
    {
        private static readonly CoreManage Bll = new CoreManage();
        private int _contentId;

        public int ContentID
        {
            get
            {
                if (this._contentId == 0)
                {
                    this._contentId = Convert.ToInt32(Page.RouteData.Values["ID"]);
                }
                return this._contentId;
            }
        }

        public string Tags { get; set; }
        public int Rows { get; set; }

        protected override void OnLoad(EventArgs e)
        {
            DataSource = Bll.RelatedContents(Rows, ContentID, Tags);
            DataBind();
        }
    }
}